<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>课程详情</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        :root {
            --primary-color: #2c5545;
            --primary-light: #3a7d62;
            --primary-hover: #1e4636;
            --accent-color: #8ba888;
            --status-draft: #b2bec3;
            --status-pending: #fdcb6e;
            --status-approved: #00b894;
            --status-rejected: #d63031;
            --status-deleted: #636e72;
            --white: #fff;
            --shadow: 0 4px 24px rgba(44, 85, 69, 0.08);
            --radius: 12px;
            --transition: all 0.3s ease;
        }
        body {
            background: #f5f7f6;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            color: #222;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 600px;
            margin: 40px auto 0 auto;
            padding: 32px 28px 24px 28px;
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }
        h1 {
            color: var(--primary-color);
            margin-bottom: 1.5rem;
            font-size: 2rem;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .info-row {
            margin-bottom: 1.1rem;
            font-size: 1.08rem;
        }
        .info-label {
            color: var(--primary-light);
            font-weight: 500;
            margin-right: 0.5rem;
        }
        .cover-img {
            max-width: 100%;
            max-height: 220px;
            border-radius: 8px;
            margin-bottom: 1.2rem;
            box-shadow: var(--shadow);
        }
        .status {
            padding: 0.3rem 0.8rem;
            border-radius: 16px;
            font-size: 0.95rem;
            font-weight: 500;
            display: inline-block;
        }
        .status-draft { background: var(--status-draft); color: #222; }
        .status-pending { background: var(--status-pending); color: #222; }
        .status-approved { background: var(--status-approved); color: #fff; }
        .status-rejected { background: var(--status-rejected); color: #fff; }
        .status-deleted { background: var(--status-deleted); color: #fff; }
        .reason {
            color: var(--status-rejected);
            font-size: 0.98rem;
            margin-top: 0.5rem;
        }
        .back-link {
            display: inline-block;
            margin-top: 1.5rem;
            padding: 0.7rem 1.5rem;
            background: var(--primary-color);
            color: var(--white);
            border: none;
            border-radius: 6px;
            font-size: 1rem;
            cursor: pointer;
            text-decoration: none;
            transition: var(--transition);
        }
        .back-link:hover {
            background: var(--primary-hover);
        }
        @media (max-width: 600px) {
            .container { padding: 12px; }
            h1 { font-size: 1.2rem; }
        }
    </style>
</head>
<body>
<div class="container">
    <h1><i class="fas fa-info-circle"></i> 课程详情</h1>
    <div class="info-row"><span class="info-label">课程名称：</span><span th:text="${course.name}"></span></div>
    <div class="info-row"><span class="info-label">作者：</span><span th:text="${course.author}"></span></div>
    <div class="info-row"><span class="info-label">简介：</span><span th:text="${course.introduction}"></span></div>
    <div class="info-row"><span class="info-label">排序：</span><span th:text="${course.sortOrder}"></span></div>
    <div class="info-row"><span class="info-label">课程封面：</span><br><img th:src="${course.coverUrl}" alt="课程封面" class="cover-img"></div>
    <div class="info-row"><span class="info-label">课程视频：</span><a th:href="${course.videoUrl}" target="_blank" th:text="${course.videoUrl}"></a></div>
    <div class="info-row">
        <span class="info-label">状态：</span>
        <span th:switch="${course.status}">
            <span th:case="0" class="status status-draft">草稿</span>
            <span th:case="1" class="status status-pending">待审核</span>
            <span th:case="2" class="status status-approved">审核通过</span>
            <span th:case="3" class="status status-rejected">审核不通过</span>
            <span th:case="4" class="status status-deleted">已删除</span>
        </span>
    </div>
    <div th:if="${course.status} == 3" class="reason">审核不通过原因：<span th:text="${course.auditReason}"></span></div>
    <a th:if="${from} == 'audit'" th:href="@{/course/audit/list}" class="back-link"><i class="fas fa-arrow-left"></i> 返回审核列表</a>
    <a th:if="${from} != 'audit'" th:href="@{/course/list}" class="back-link"><i class="fas fa-arrow-left"></i> 返回列表</a>
</div>
</body>
</html> 